/**
 * Licensed to Open-Ones Group under one or more contributor license
 * agreements. See the NOTICE file distributed with this work
 * for additional information regarding copyright ownership.
 * Open-Ones Group licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a
 * copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package mks.webshop.gae.security;

import java.io.Serializable;
import java.util.Set;

/**
 * @author thachle
 *
 */
public class GaeUser implements Serializable {    
    private String userId;
    private String email;
    private String nickname;
    private String forename;
    private String surname;
    private Set<AppRole> authorities;
    private boolean enabled;
    
    public GaeUser(String userId, String nickname, String email) {
        this.userId = userId;
        this.nickname = nickname;
        this.email = email;
    }

    public GaeUser(String name, String nickname, String email, String forename, String surname,
            Set<AppRole> roles, boolean enable) {
        this.userId = name;
        this.nickname = nickname;
        this.email = email;
        this.forename = forename;
        this.surname = surname;
        this.authorities = roles;
        this.enabled = enable;
    }

    /**
     * Get value of userId.
     * @return the userId
     */
    public String getUserId() {
        return userId;
    }

    /**
     * Set the value for userId.
     * @param userId the userId to set
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /**
     * Get value of email.
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * Set the value for email.
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * Get value of nickname.
     * @return the nickname
     */
    public String getNickname() {
        return nickname;
    }

    /**
     * Set the value for nickname.
     * @param nickname the nickname to set
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * Get value of forename.
     * @return the forename
     */
    public String getForename() {
        return forename;
    }

    /**
     * Set the value for forename.
     * @param forename the forename to set
     */
    public void setForename(String forename) {
        this.forename = forename;
    }

    /**
     * Get value of surname.
     * @return the surname
     */
    public String getSurname() {
        return surname;
    }

    /**
     * Set the value for surname.
     * @param surname the surname to set
     */
    public void setSurname(String surname) {
        this.surname = surname;
    }

    /**
     * Get value of authorities.
     * @return the authorities
     */
    public Set<AppRole> getAuthorities() {
        return authorities;
    }

    /**
     * Set the value for authorities.
     * @param authorities the authorities to set
     */
    public void setAuthorities(Set<AppRole> authorities) {
        this.authorities = authorities;
    }

    /**
     * Set the value for enabled.
     * @param enabled the enabled to set
     */
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isEnabled() {
        return this.enabled;
    }
}
